import request from '@/utils/request.js'

const api_name = '/portal/course'

//课程分页列表
export function getCoursePageList (page, limit, queryParams) {
  return request({
    url: `${api_name}/${page}/${limit}`,
    method: 'get',
    params: queryParams
  })
}

// 根据课时id获取课时信息
export function getPeriod (id) {
  return request({
    url: `${api_name}/period/${id}`,
    method: 'get'
  })
}

//根据章节id判断课程是否免费
export function getCourseIsFree (id) {
  return request({
    url: `${api_name}/chapter/${id}`,
    method: 'get'
  })
}

//根据视频id查询课时信息
export function getPeriodInfo (id) {
  return request({
    url: `${api_name}/period/video/${id}`,
    method: 'get'
  })
}

//根据视频id查询课时视频信息
export function getPeriodVideo (id) {
  return request({
    url: `${api_name}/video/${id}`,
    method: 'get'
  })
}
